import React, {memo} from 'react'

function MyComponent() {
    console.log('MyComponent 更新了')
    return (
        <div>MyComponent</div>
    )
}
const setStatisfactionClass = (level) => {
    if (level < 100) {
        return '非常糟糕'
    }
    if (level < 200) {
        return '有点糟糕'
    }
    if (level < 300) {
        return '还行'
    }
    if (level < 400) {
        return '满意'
    }
    return '非常满意'
}
// props level 
const isSameRange = (preveValue, nextValue) => {
    // console.log(preveValue,nextValue)
    const preValueClass = setStatisfactionClass(preveValue.level)
    const nextValueClass = setStatisfactionClass(nextValue.level)
    // console.log(preValueClass, nextValueClass)
    return preValueClass === nextValueClass
}
export default memo(MyComponent, isSameRange) 